import 'package:flutter/material.dart';

/// * 作者: Tao
/// * 日期: 2024/3/20
/// * 时间: 11:08
/// * 描述: 自定义滑动行为
class OverScrollBehavior extends ScrollBehavior {
  Widget buildViewportChrome(
      BuildContext context, Widget child, AxisDirection axisDirection) {
    if (getPlatform(context) == TargetPlatform.android ||
        getPlatform(context) == TargetPlatform.fuchsia) {
      return GlowingOverscrollIndicator(
        showLeading: false,
        showTrailing: false,
        axisDirection: axisDirection,
        color: Theme.of(context).primaryColor,
        child: child,
      );
    } else {
      return child;
    }
  }
}
